﻿using System;

namespace SoftSource.MVVMC
{
    public interface IEditorConsume : IViewModelConsume
    {
        Action Cancel { get; }
        IObservable<Unit> Save { get; }
        IObservable<Unit> Apply { get; }
        Action<Exception> Failure { get; }
    }
    public interface IEditorService : IViewModelService
    {
        Action Cancel { get; set; }
        IObservable<Unit> Save { get; set; }
        IObservable<Unit> Apply { get; set; }
        Action<Exception> Failure { get; set; }
    }
    public interface IEditor : IViewModel, IEditorConsume, IEditorService
    { }

    public interface IEditorConsume<T> : IViewModelConsume
    {
        Action Cancel { get; }
        Func<T, IObservable<Unit>> Save { get; }
        Func<T, IObservable<Unit>> Apply { get; }
        Action<Exception> Failure { get; }
    }
    public interface IEditorService<T> : IViewModelService
    {
        Action Cancel { get; set; }
        Func<T, IObservable<Unit>> Save { get; set; }
        Func<T, IObservable<Unit>> Apply { get; set; }
        Action<Exception> Failure { get; set; }
    }
    public interface IEditor<T> : IViewModel, IEditorConsume<T>, IEditorService<T>
    { }
}
